/*
 * @Descripttion: GGB
 * @version: 1.0
 * @Author: GGB
 * @Date: 2021-08-19 14:09:46
 * @LastEditors: GGB
 * @LastEditTime: 2021-08-19 14:40:24
 */
import 'package:flutter/material.dart';
import 'package:flutter_data_center/model/common/menu_model.dart';
import 'package:flutter_data_center/utills/color_utils.dart';

class WarningType extends StatelessWidget {
  const WarningType({Key key, this.types, this.type, this.onTap})
      : super(key: key);
  final List<MenuModel> types;
  final String type;
  final ValueChanged onTap;

  @override
  Widget build(BuildContext context) => Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Text(
            "类别",
            style: TextStyle(
              fontSize: 18,
            ),
          ),
          SizedBox(height: 10),
          Row(
            children: types
                .map(
                  (e) => Flexible(
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.start,
                      children: [
                        SizedBox(
                          width: 25,
                          height: 25,
                          child: Radio(
                            activeColor: Theme.of(context).primaryColor,
                            value: e.key,
                            groupValue: type,
                            onChanged: onTap,
                          ),
                        ),
                        SizedBox(width: 10),
                        Text(
                          e.value,
                          style: TextStyle(
                            fontSize: 16,
                            color: gColor("#969696"),
                          ),
                        ),
                      ],
                    ),

                    // RadioListTile(
                    //   contentPadding: EdgeInsets.all(0),
                    //   activeColor: Theme.of(context).primaryColor,
                    // title: Text(
                    //   e.value,
                    //   style: TextStyle(
                    //     fontSize: 16,
                    //     color: gColor("#969696"),
                    //   ),
                    // ),
                    //   value: e.key,
                    //   groupValue: type,
                    //   onChanged: onTap,
                    // ),
                  ),
                )
                .toList(),
          ),
        ],
      );
}
